package com.spic.system.api.factory;

import com.spic.common.core.web.domain.AjaxResult;
import com.spic.system.api.RemoteActivitiTaskService;
import com.spic.system.api.domain.ActTaskStartDto;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author mos
 * @version 1.0
 * @description: TODO
 * @date 2021/10/11 17:59
 */
@Component
public class RemoteActivitiFallbackFactory implements FallbackFactory<RemoteActivitiTaskService> {
    @Override
    public RemoteActivitiTaskService create(Throwable cause) {
        return new RemoteActivitiTaskService() {
            @Override
            public AjaxResult startInstance(ActTaskStartDto actTaskStartDto, String source) {
                return  AjaxResult.error("服务异常，请稍后重试");
            }
            @Override
            public AjaxResult getHistoryInfoList(String procInstId)
            {
                return  AjaxResult.error("服务异常，请稍后重试");
            }

            @Override
            public AjaxResult getMulitInstanceTask(String processInstanceId,String definitonKey)
            {
                 return  AjaxResult.error("服务异常，请稍后重试");
            }

            @Override
            public AjaxResult getRunTaskInstanceTask(String processInstanceId)
            {
                return AjaxResult.error("服务异常，请稍后重试");
            }
        };
    }
}
